interface IPoint{
    x:number;
    y:number;
    code:number;
    drawPoint:()=>void;
    getDistance:(p:IPoint)=>number;
}

export class Point implements IPoint{
    private password:number=666666;
    x:number;
    constructor(x:number,public y:number){
        this.x=x;
    };
    drawPoint=()=>{
        console.log(`(${this.x},${this.y})`);
    };
    getDistance=(p:IPoint)=>{
        return Math.pow(p.x-this.x,2)+Math.pow(p.y-this.y,2);
    };
    set code(value:number){
        this.password=value;
    };
    get code(){
        return this.password;
    };
};

abstract class Animal{
    public constructor(public name:string){};
    protected abstract shout():void;
}

class Cat extends Animal{
    constructor(name:string) {
        super(name);
    };
    public shout(){
        console.log('Mio~');
    };
    static composition = 'water';
    static show(){
        console.log('cute');
    };
}

let cat = new Cat('Judy');
cat.shout();
Cat.show();
console.log(Cat.composition);
